package com.vanysoft.business.data.service.impl;

import com.baomidou.mybatisplus.plugins.Page;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.vanysoft.business.data.dao.CategoryListMapper;
import com.vanysoft.business.data.entity.CategoryList;
import com.vanysoft.business.data.service.CategoryListService;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * <p>
 * 服务实现类
 * </p>
 *
 * @author YangLei
 * @since 2018-07-09
 */
@Service
public class CategoryListServiceImpl extends ServiceImpl<CategoryListMapper, CategoryList> implements CategoryListService {

    @Override
    public Page<CategoryList> selectPage(Page<CategoryList> page, String code, String des, String level) {
        Map<String, Object> map = new HashMap<>();
        map.put("code", code);
        map.put("des", des);
        map.put("level", level);
        List<CategoryList> list = baseMapper.selectPage(page, map);
        page.setRecords(list);
        return page;
    }

    @Override
    public List<CategoryList> selectAll(String key) {
        return baseMapper.selectAll(key);
    }
}
